/**
 * 游戏配置文件
 * 集中管理所有游戏常量和配置
 */

export const GAME_CONFIG = {
    // 游戏基础配置
    GAME_NAME: '镇长日志',
    SAVE_KEY: 'mayorLogGame',
    AUTO_SAVE_INTERVAL: 60000, // 自动保存间隔（60秒）
    RESOURCE_UPDATE_INTERVAL: 10000, // 资源更新间隔（10秒）
    EVENT_CHECK_INTERVAL: 1800000, // 事件检查间隔（30分钟）
    INITIAL_EVENT_DELAY: 60000, // 首个事件延迟（1分钟）

    // 资源配置
    RESOURCES: {
        INITIAL_WOOD: 50,
        INITIAL_FOOD: 50,
        INITIAL_POPULATION: 5,
        INITIAL_MAX_POPULATION: 10,
        FOOD_CONSUMPTION_PER_HOUR: 2, // 每人每小时消耗
        STARVATION_PENALTY: 0.9, // 饥饿惩罚（人口减少系数）
    },

    // 招募配置
    RECRUIT: {
        BASE_WOOD_COST: 20,
        BASE_FOOD_COST: 50,
        COST_MULTIPLIER: 1.1, // 每次招募后成本增加
    },

    // 建筑配置
    BUILDINGS: {
        UPGRADE_COST_MULTIPLIER: 1.4, // 升级成本增长倍数（从1.5降到1.4）
        EFFICIENCY_GROWTH: 0.1, // 每级效率增长
        HOUSE_POPULATION_INCREASE: 5, // 民房每级增加人口上限
    },

    // 签到奖励配置
    DAILY_REWARD: {
        WOOD_PER_DAY: 20,
        FOOD_PER_DAY: 20,
    },

    // 游戏阶段配置
    STAGES: {
        SURVIVAL: {
            id: 'survival',
            name: '生存阶段',
            description: '努力生存，发展基础设施'
        },
        DEVELOPMENT: {
            id: 'development',
            name: '发展阶段',
            description: '村庄开始繁荣，解锁更多功能',
            requirements: {
                population: 15,
                buildingUnlocked: 'school'
            }
        },
        PROSPERITY: {
            id: 'prosperity',
            name: '繁荣阶段',
            description: '村庄达到繁荣，成为区域中心',
            requirements: {
                population: 30,
                buildingsLevel5: ['farm', 'sawmill', 'house']
            }
        },
        LEGEND: {
            id: 'legend',
            name: '传奇阶段',
            description: '村庄成为传奇，名扬四海',
            requirements: {
                population: 50,
                allBuildingsUnlocked: true
            }
        }
    },

    // UI配置
    UI: {
        NOTIFICATION_DURATION: 3000, // 通知显示时长（毫秒）
        LOG_MAX_ENTRIES: 50, // 最多保留的日志条目
        ANIMATION_DURATION: 300, // 动画时长（毫秒）
    },

    // 图标映射
    ICONS: {
        wood: 'fa-tree',
        food: 'fa-leaf',
        population: 'fa-users',
        farm: 'fa-leaf',
        sawmill: 'fa-tree',
        house: 'fa-home',
        school: 'fa-book',
        market: 'fa-shopping-basket',
        default: 'fa-building'
    },

    // 颜色配置
    COLORS: {
        wood: '#DEB887',
        food: '#8BC34A',
        population: '#F08080',
        primary: '#2D6A4F',
        secondary: '#95D5B2',
        accent: '#FFB703',
        danger: '#E63946',
        success: '#4CAF50',
        warning: '#FF9800',
    }
};

// 初始建筑数据
export const INITIAL_BUILDINGS = [
    {
        id: 'farm',
        name: '农田',
        description: '生产粮食，维持人口生存',
        level: 1,
        efficiency: 1.0,
        unlocked: true,
        baseProduction: 5,
        upgradeCost: { wood: 30, food: 20 },
        unlockCost: null
    },
    {
        id: 'sawmill',
        name: '伐木场',
        description: '生产木材，用于建筑升级',
        level: 1,
        efficiency: 1.0,
        unlocked: true,
        baseProduction: 5,
        upgradeCost: { wood: 40, food: 10 },
        unlockCost: null
    },
    {
        id: 'house',
        name: '民房',
        description: '增加人口上限',
        level: 1,
        efficiency: 1.0,
        unlocked: true,
        baseProduction: 0,
        upgradeCost: { wood: 50, food: 30 },
        unlockCost: null
    },
    {
        id: 'school',
        name: '学校',
        description: '提高村民技能，增加生产效率',
        level: 1,
        efficiency: 1.0,
        unlocked: false,
        baseProduction: 0,
        upgradeCost: { wood: 100, food: 50 },
        unlockCost: { wood: 200, food: 100 }
    },
    {
        id: 'market',
        name: '市场',
        description: '解锁贸易功能',
        level: 1,
        efficiency: 1.0,
        unlocked: false,
        baseProduction: 0,
        upgradeCost: { wood: 150, food: 80 },
        unlockCost: { wood: 300, food: 150 }
    }
];

// 初始村民姓名池
export const VILLAGER_NAMES = [
    '张三', '李四', '王五', '赵六', '钱七',
    '孙八', '周九', '吴十', '郑十一', '王十二',
    '陈十三', '李十四', '张十五', '刘十六', '杨十七'
];

// 初始村民数据
export const INITIAL_VILLAGERS = [
    { id: 1, name: '张三', skills: { farming: 1, woodcutting: 1 } },
    { id: 2, name: '李四', skills: { farming: 1, woodcutting: 1 } },
    { id: 3, name: '王五', skills: { farming: 1, woodcutting: 1 } },
    { id: 4, name: '赵六', skills: { farming: 1, woodcutting: 1 } },
    { id: 5, name: '钱七', skills: { farming: 1, woodcutting: 1 } }
];
